// 登入按钮
$("#login-button").click(function(){
	$.ajax({
		url:"https://www.easy-mock.com/mock/5a6e8476376cc81223703e9d/test",
		type:"get",
		dataType:"json",
		success:function(s){
			console.log(s.data.user.name);
			$("#user-name").text(s.data.user.name);
			$("#login-button2").text(s.data.user.name);
		},	
		fail: function (f) {
			console.log("Fail");
			alert("登入失败");
		}
	});
});
// 请登入按钮
$("#login-button2").click(function(){
	$.ajax({
		url:"https://www.easy-mock.com/mock/5a6e8476376cc81223703e9d/test",
		type:"get",
		dataType:"json",
		success:function(s){
			console.log(s.data.user.name);
			$("#user-name").text(s.data.user.name);
			$("#login-button2").text(s.data.user.name);
		},	
		fail: function (f) {
			console.log("Fail");
			alert("登入失败");
		}
	});
});